package com.wang.service.impl;

import com.aaa.vo.Result;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wang.entity.EmpVo1;
import com.wang.mapper.EmpMapper;
import com.wang.service.EmpVoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author :  DongZheng Wang
 * @PROJECT_NAME: fifth-cai-parent
 * @date :  2023-02-28 15:30
 **/
@Service
public class EmpVoServiceImpl  extends ServiceImpl<EmpMapper, EmpVo1> implements EmpVoService {
    @Autowired
    private EmpMapper empMapper;

    @Override
    public Result empVo1(Integer currentPage, Integer pageSize, String startTime, String endTime) {
        PageHelper.startPage(currentPage,pageSize);
        List<EmpVo1> one = empMapper.findOne(startTime, endTime);
        PageInfo<EmpVo1>pageInfo=new PageInfo(one);
        System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"+pageInfo);
        return new Result(2000,"success",pageInfo);
    }
}
